 {include file="public_iframe:head"}
<link rel="stylesheet" href="__STATIC__/admin/jq22jquery-enlargement879920160816/css/bootstrap-grid.min.css">
<link rel="stylesheet" href="__STATIC__/admin/jq22jquery-enlargement879920160816/dist/zoomify.min.css">
<link rel="stylesheet" href="__STATIC__/admin/jq22jquery-enlargement879920160816/css/style.css">
<script type="text/javascript" charset="utf-8" src="__STATIC__/editor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="__STATIC__/editor/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="__STATIC__/editor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" charset="utf-8" src="__STATIC__/admin/jq22jquery-enlargement879920160816/dist/zoomify.min.js"></script>
<script src="__STATIC__/laydate/laydate.js"></script>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>任务审核</h5>
            <div class="ibox-tools" style="margin-top: -9px;">
                <a href="javascript:history.go(-1);" class="btn btn-primary"><i class="fa fa-arrow-left"></i> 返回</a>
            </div>
        </div>
        <div class="ibox-content">

            <form action="" method="post" enctype="multipart/form-data" id="brandForm" class="form-horizontal">
                    <input type="hidden" name="id" value="{$da.id?$da.id:'';}">
                    <input type="hidden" name="recommend_id" value="{$da.recommend_id?$da.recommend_id:'';}">
                    <div class="hr-line-dashed"></div>
                     <div class="form-group">
                        <label class="col-sm-6 control-label">会员名称:{$da.account}</label>
                    </div>

                    <div class="hr-line-dashed"></div>
                     <div class="form-group">
                        <label class="col-sm-6 control-label">会员ID:{$da.uid}</label>
                    </div>
                    
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                            <label class="col-sm-2 control-label">审核状态</label>
                            <select class="col-sm-6"  id="status">
                                <option value="1">待审核</option>
                                <option value="2">审核通过</option>
                                <option value="3">审核不通过</option>
                            </select>
                    </div>    
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">收入金额</label>
                        <div class="col-sm-6">
                            <input type="text" name="money" id="money" value="{$da.money?$da.money:'';}" class="form-control" placeholder="金" >
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>
                     <div class="form-group">
                        <label class="col-sm-2 control-label">任务内容</label>
                        <div class="col-sm-6">
                            <input type="text" name="content" id="content" value="{$da.content?$da.content:'';}" class="form-control" placeholder="任务内容" >
                        </div>
                    </div>


                    <input type="hidden" name="task_record_id" id="task_record_id" value="{$da.task_record_id?$da.task_record_id:'';}" class="form-control" placeholder="任务编号" >
              <!--       <div class="hr-line-dashed"></div>
                     <div class="form-group">
                        <label class="col-sm-2 control-label">任务编号</label>
                        <div class="col-sm-6">
                            <input type="text" name="task_record_id" id="task_record_id" value="{$da.task_record_id?$da.task_record_id:'';}" class="form-control" placeholder="任务编号" >
                        </div>
                    </div> -->
                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">任务图片</label>
                        <div class="col-sm-6" id="example" >
                            (备注: 宽度  高度;)
                            {if condition="isset($da.img2)"}
                            {volist name="$da.img2" id="im"}
                                <img src="{$im}" class="img-rounded" style="width: 100px;height: 100px;">
                            {/volist}
                            {/if}
                         
                        </div>
                    </div>

                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">图片</label>
                        <div class="col-sm-6" id="example_img">
                          <!--   <input type="file" name="task_img" class="form-control" > -->
                            {if condition="isset($da.img_array)"}(备注: 宽度  高度;)
                            {volist name="$da.img_array" id="img"}
                                <img class="img-rounded" src="{$img['task_img']}" alt="" style="width: 100px;height: 100px;">
                            {/volist}
                            {/if}
                        </div>
                    </div>
                    
                    <div class="hr-line-dashed"></div>
                     <div class="form-group">
                        <label class="col-sm-2 control-label">填写理由</label>
                        <div class="col-sm-6">
                            <input type="text" name="reason" id="reason" value="{$da.reason?$da.reason:'';}" class="form-control" placeholder="不通过理由" >
                        </div>
                    </div>

                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <div class="col-sm-4 col-sm-offset-2">
                            <!--<button class="btn btn-primary" type="submit">提交</button>-->
                            <!--href="JavaScript:void(0);" onclick="roleSubmit();"-->
                            <a href="JavaScript:void(0);" onclick="Submit();" class="btn btn-primary" id="submit">提交</a>
                        </div>
                    </div>
       
            </form>
        </div>
    </div>
    <!-- End Panel Basic -->
</div>
<script type="text/javascript">
    $('#example img').zoomify();
    $('#example_img img').zoomify();
</script>
<script>

    //时间选择器
   //时间选择器
/*    laydate.render({
      elem: '#test1'
      ,type: 'datetime'
    });*/
        function Submit(){
        var formData = new FormData();
        var id = $('input[name="id"]').val();
        var recommend_id = $('input[name="recommend_id"]').val();

        var myselect=document.getElementById("status");
        var index = myselect.selectedIndex;
        var status = myselect.options[index].value;

        var money = $('input[name="money"]').val();
        
        var task_record_id = $('input[name="task_record_id"]').val();
        var content = $('input[name="content"]').val();

        var reason = $('input[name="reason"]').val();
/*
        var file = $('input[type="file"]');
        // var iLen = this.files.length;
        var file = $('input[name="task_img"]');
        var task_img = file.get(0).files[0];*/
        // console.log(task_img);
        
       /* var time =$('input[id="test1"]').val();
        var task_content = ue.getContent();
        var file = $('input[name="task_picture_url"]');
        var task_picture_url = file.get(0).files[0];*/

        formData.append('id',id);
        formData.append('recommend_id',recommend_id);
        formData.append('status',status);
        formData.append('reason',reason);
        
        formData.append('task_record_id',task_record_id);
        formData.append('money',money);
       /* formData.append('time',time);*/
        formData.append('content',content);
 /*       formData.append('task_img',task_img);*/

        $.ajax({
            url:"{:url('Mission/doedit_examine')}",
            type:'POST',
            data:formData,
            async:false,
            processData:false,
            contentType:false,
            success:function(result) {
                console.log(result);
                if(result.code == '0'){
                    parent.layer.alert(result.msg);
                }else{
                    parent.layer.msg(result.msg,{
                                icon:1,
                                time:1000,
                            },
                            function (index, item) {
                                window.location.href="{:url('Mission/examine_mission')}";
                            });
                }
            }
        });
    }
</script>
<script type="text/javascript">

    //实例化编辑器
    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
    var ue = UE.getEditor('editor');


    function isFocus(e){
        alert(UE.getEditor('editor').isFocus());
        UE.dom.domUtils.preventDefault(e)
    }
    function setblur(e){
        UE.getEditor('editor').blur();
        UE.dom.domUtils.preventDefault(e)
    }
    function insertHtml() {
        var value = prompt('插入html代码', '');
        UE.getEditor('editor').execCommand('insertHtml', value)
    }
    function createEditor() {
        enableBtn();
        UE.getEditor('editor');
    }
</script>
<script type="text/javascript">
    //实例化编辑器
    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
    var ues = UE.getEditor('editor_two');

    function isFocus(e){
        alert(UE.getEditor('editor_two').isFocus());
        UE.dom.domUtils.preventDefault(e)
    }
    function setblur(e){
        UE.getEditor('editor_two').blur();
        UE.dom.domUtils.preventDefault(e)
    }
    function insertHtml() {
        var value = prompt('插入html代码', '');
        UE.getEditor('editor_two').execCommand('insertHtml', value)
    }
    function createEditor() {
        enableBtn();
        UE.getEditor('editor_two');
    }
</script>
</body>

</html>